﻿#ifndef TURNTABLESTATE_H
#define TURNTABLESTATE_H

#include <qobject.h>

#include "TurnTableCodec.h"

class TurnTableState : public QObject
{
  Q_OBJECT
private://property
  TurnTableCodec::ConnectionState turnTableConnectionState = TurnTableCodec::State_Disconnected;//转台连接状态位
  TurnTableCodec::ConnectionState thermostatConnectionState = TurnTableCodec::State_Disconnected;//温箱连接状态位

  TurnTableCodec::TurnTableLoadMode turnTableLoadMode = TurnTableCodec::Mode_Loaded;//负载状态位
  TurnTableCodec::TargetState turnTablePositionModeState = TurnTableCodec::State_NotReached;//位置是否达到状态位
  TurnTableCodec::TargetState turnTableRateModeState = TurnTableCodec::State_NotReached;//速率是否达到状态位
  TurnTableCodec::TargetState turnTableStopState = TurnTableCodec::State_NotReached;//停止是否达到状态位
  TurnTableCodec::TurnTablePowerSupplyState turnTablePowerSupplyState = TurnTableCodec::State_PowerOff; //转台电源供应状态位
  TurnTableCodec::TurnTableCircuitState turnTableCircuitState = TurnTableCodec::State_CircuitOpened; //转台电路状态位
  TurnTableCodec::TurnTableAmplifierState turnTableAmplifierState = TurnTableCodec::State_AmplifierNormal; //转台功放机状态位
  TurnTableCodec::TurnTableRunningState turnTableRunningState = TurnTableCodec::State_TurnTableStoped;//转台运行状态位
  TurnTableCodec::TurnTableSearchZeroState turnTableSearchZeroState = TurnTableCodec::State_NotSearch;//转台寻零状态位
  TurnTableCodec::TurnTableRunningMode turnTableRunningMode = TurnTableCodec::Mode_RateMode;//转台运行模式状态位

  float turnTableCurrentPosition = 0;//转台当前位置
  float turnTableCurrentRate = 0;//转台当前速率
  float turnTableTargetPosition = 0;//目标位置
  float turnTableTargetRate = 0;//目标速率
  float turnTableTargetAcceleration = 0;//目标加速度

  float thermostatCurrentTemperature = 0;//温箱当前温度
  float thermostatTargetTemperature = 0;//温箱目标温度
  float thermostatTemperatureRate = 0;//温箱变温速率
public:
  explicit TurnTableState();
  TurnTableState(TurnTableState const& turnTableState);
  TurnTableState& operator=(TurnTableState const& turnTableState);
  virtual ~TurnTableState();
signals:
public://geter and seter
  TurnTableCodec::ConnectionState getTurnTableConnectionState();
  TurnTableState* setTurnTableConnectionState(TurnTableCodec::ConnectionState turnTableConnectionState);
  TurnTableCodec::ConnectionState getThermostatConnectionState();
  TurnTableState* setThermostatConnectionState(TurnTableCodec::ConnectionState thermostatConnectionState);
  TurnTableCodec::TurnTableLoadMode getTurnTableLoadMode();
  TurnTableState* setTurnTableLoadMode(TurnTableCodec::TurnTableLoadMode turnTableLoadMode);
  TurnTableCodec::TargetState getTurnTablePositionModeState();
  TurnTableState* setTurnTablePositionModeState(TurnTableCodec::TargetState turnTablePositionModeState);
  TurnTableCodec::TargetState getTurnTableRateModeState();
  TurnTableState* setTurnTableRateModeState(TurnTableCodec::TargetState turnTableRateModeState);
  TurnTableCodec::TargetState getTurnTableStopState();
  TurnTableState* setTurnTableStopState(TurnTableCodec::TargetState turnTableStopState);
  TurnTableCodec::TurnTablePowerSupplyState getTurnTablePowerSupplyState();
  TurnTableState* setTurnTablePowerSupplyState(TurnTableCodec::TurnTablePowerSupplyState turnTablePowerSupplyState);
  TurnTableCodec::TurnTableCircuitState getTurnTableCircuitState();
  TurnTableState* setTurnTableCircuitState(TurnTableCodec::TurnTableCircuitState turnTableCircuitState);
  TurnTableCodec::TurnTableAmplifierState getTurnTableAmplifierState();
  TurnTableState* setTurnTableAmplifierState(TurnTableCodec::TurnTableAmplifierState turnTableAmplifierState);
  TurnTableCodec::TurnTableRunningState getTurnTableRunningState();
  TurnTableState* setTurnTableRunningState(TurnTableCodec::TurnTableRunningState turnTableRunningState);
  TurnTableCodec::TurnTableSearchZeroState getTurnTableSearchZeroState();
  TurnTableState* setTurnTableSearchZeroState(TurnTableCodec::TurnTableSearchZeroState turnTableSearchZeroState);
  TurnTableCodec::TurnTableRunningMode getTurnTableRunningMode();
  TurnTableState* setTurnTableRunningMode(TurnTableCodec::TurnTableRunningMode turnTableRunningMode);
  float getTurnTableCurrentPosition();
  TurnTableState* setTurnTableCurrentPosition(float turnTableCurrentPosition);
  float getTurnTableCurrentRate();
  TurnTableState* setTurnTableCurrentRate(float turnTableCurrentRate);
  float getTurnTableTargetPosition();
  TurnTableState* setTurnTableTargetPosition(float turnTableTargetPosition);
  float getTurnTableTargetRate();
  TurnTableState* setTurnTableTargetRate(float turnTableTargetRate);
  float getTurnTableTargetAcceleration();
  TurnTableState* setTurnTableTargetAcceleration(float turnTableTargetAcceleration);
  float getThermostatCurrentTemperature();
  TurnTableState* setThermostatCurrentTemperature(float thermostatCurrentTemperature);
  float getThermostatTargetTemperature();
  TurnTableState* setThermostatTargetTemperature(float thermostatTargetTemperature);
  float getThermostatTemperatureRate();
  TurnTableState* setThermostatTemperatureRate(float thermostatTemperatureRate);
};

#endif // TURNTABLESTATE_H
